package org.bits.data;

import java.util.ArrayList;
import java.util.List;

import org.bits.data.fields.*;

/*******************************************************************************
 * 
 ******************************************************************************/
public class UserOptions
{
    /**  */
    public List<Filter<?>> filters;

    /***************************************************************************
     * 
     **************************************************************************/
    public UserOptions()
    {
        filters = new ArrayList<Filter<?>>();
    }

    /***************************************************************************
     * @return
     **************************************************************************/
    public static UserOptions createDefaultOptions()
    {
        UserOptions options = new UserOptions();

        Filter<Finding> findingFilter;

        findingFilter = new Filter<Finding>( FilterDataType.FINDING );
        findingFilter.setName( "My Open Findings" );
        findingFilter.addDisplayField( new FindingNumberField() );
        findingFilter.addDisplayField( new FindingTitleField() );
        options.filters.add( findingFilter );

        Filter<Issue> issueFilter;

        issueFilter = new Filter<Issue>( FilterDataType.ISSUE );
        issueFilter.setName( "My Open Issues" );
        issueFilter.addDisplayField( new IssueNumberField() );
        issueFilter.addDisplayField( new IssueTitleField() );
        issueFilter.addDisplayField( new IssueStateField() );
        options.filters.add( issueFilter );

        // TODO add default filters for user.

        return options;
    }
}
